#pragma once

#include "dsegen.h"
#include "Segment.h"
#include "BlockDesign.h"
#include "FindNeighbor.h"
#include "HRTimer.h"
#include "BlockVertical.h"
#include "BlockChessboard.h"
#include "PathInfo.h"
#include "CalcDissimilarity.h"

namespace dhis
{
	//------------------------------------------------------------------------------
	bool _parallel_fast_scanning(std::vector<CMacroBlock*>& blocks,CImageInfo* pImg, CParameter* pPara,std::ofstream& strm);

	//------------------------------------------------------------------------------
	bool _parallelFastScanningSegment(CImageInfo* pImg, CParameter* pPara,CBlockChessboard& blockChess,std::ofstream& strm);

	//------------------------------------------------------------------------------
	bool _fastScanningSegmentBlock(const CRectI& rect, ObjectMap& objs, const CImageInfo* pImg, const CParameter* pPara);

	//------------------------------------------------------------------------------
	void _fastScanningSegmentBoundaryLine(const CImageInfo* img,const CParameter* para,BoundaryLineVec& bounds,GDALDataset *pSrcDS,int* tags,ObjectMap& objs);

	//------------------------------------------------------------------------------
	void  _getObjectNeighbors(int* tags,const int& nXSize,const int& nYSize,const CRegionObject* obj,NeighborList& nbrs);

	//------------------------------------------------------------------------------
	void  _initObjectNeighbors(CMacroBlock* block,int* tags);

	//------------------------------------------------------------------------------
	void _initFrontierObjectNeighbors(std::vector<CMacroBlock*>& blocks,int* tags);

	//------------------------------------------------------------------------------
	void _initTopotaxy(std::vector<CMacroBlock*>& blocks,int* tags,std::ofstream& strm);

	//------------------------------------------------------------------------------
	bool _serialFastScanningSegment(const CImageInfo* pImg,const CParameter* pPara,CBlockChessboard& blockChess,BlockMap& blocks);

	//------------------------------------------------------------------------------
	void  _getObjectNeighbors(std::vector<int>& tags,const int& nXSize,const int& nYSize,const CRegionObject* obj,std::set<CNeighbor>& nbrs);

	//------------------------------------------------------------------------------
	void  _initObjectNeighbors(CImageInfo* img,CParameter& para,ObjectMap& objs,std::vector<int>& tags);

}



